<!doctype html>
<html>
<head>
    <title>{$INI['system']['sitename']} {$city['name']}</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <link rel="stylesheet" href="/css/style.css">
    <link rel="stylesheet" href="/css/font-awesome.min-4.3.0.css">
	<script src="/js/jquery.min-2.1.3.js"></script>
	<script>
	$(function(){
		$(".fixed_nav_item").each(function(){
			$this = $(this);
			if($this[0].href==String(window.location)){
				$this.addClass("nav_cur");
			}    
		});
	})
	</script>
</head>

<body>
  <div>
    <div></div>			
    <div class="nav_fixed">
        <a href="/order/index.php" class="fixed_nav_item"><span class="nav_txt">全部订单</span></a>
        <a href="/order/index.php?s=unpay" class="fixed_nav_item">
		<span class="/order/index.php?s=unpay">待付款<b class="nav_payment_num" style="display:none;">2</b></span></a>
        <a href="/order/index.php?s=pay" class="fixed_nav_item">
		<span class="nav_txt nav_receiving">待收货<b class="nav_receiving_num" style="display:none;">3</b></span></a>
    </div>
	
    <div id="dealliststatus1">
		<div id="order_list">
		<!--{loop $orders $index $one}-->	
        <div class="order" id="orderdel_{$one['id']}">
            <div class="order_hd">
				${date('Y-m-d H:i:s',$one['create_time'])}
            </div>
			<div class="order_bd">
				<div class="order_glist">
					<a href="/order/view.php?id={$one['id']}">
						<div class="order_goods">
							<div class="order_goods_img">  
								<img alt="" src="${team_image($teams[$one['team_id']]['image'])}">
							</div>
							<div class="order_goods_info">
								<div class="order_goods_name">{$teams[$one['team_id']]['title']}</div>
								<div class="order_goods_attr">
									<div class="order_goods_attr_item">
										<div class="order_goods_price"><i>¥</i>
										<!--{if $one['is_pin'] == 1}-->
										${moneyit($teams[$one['team_id']]['pin_price'])}
										<!--{else}-->
										${moneyit($teams[$one['team_id']]['team_price'])}
										<!--{/if}-->
										<i>/件</i></div>数量：{$one['quantity']}
									</div>
								</div>
							</div>
						</div>
					</a>
					<div class="order_ft">
						<div class="order_total">
							<span class="order_total_info">共{$one['quantity']}件商品 ，<!--{if $one['fare']>0}-->运费：${moneyit($one['fare'])}元<!--{else}-->免运费<!--{/if}--></span>
							<span class="order_price">实付：<b>¥${moneyit($one['origin'])}</b></span>
							<span class="coupon_icon" ></span>
						</div>
						
						<!--{if ($one['state']=='unpay'&&$teams[$one['team_id']]['close_time']==0)}-->
						
						<!--{if $one['rstate']=='berefund'}-->
						<div class="order_opt">
							<span class="order_status">已退款.</span>
							
						</div>
						<!--{else}-->
						<div class="order_opt">
							<span class="order_status">待支付</span>
							<div class="order_btn">
								<a class="order_btn_buy" href="/order/check.php?id={$one['id']}">去支付</a>
								<a onclick="orderdel({$one['id']})" href="javascript:;">取消订单</a>
							</div>
						</div>
						<!--{/if}-->
						
						
						<!--{elseif $one['state']=='pay'}-->
						<div class="order_opt">
							<span class="order_status">已支付
							<!--{if $one['express_id']&&$one['express_no']}-->
						   已发货
						<!--{else}-->
							请耐心等待发货
						<!--{/if}-->
							</span>
							<div class="order_btn">
							<!--{if $one['express_id']&&$one['express_no']}-->
								<a class="order_btn_receive" href="/order/view.php?id={$one['id']}">查看物流</a>
								<!--{/if}-->
								<!--{if $one['is_get']==1}-->
								<span class="order_status" style="margin-left:5px;">已收货</span>
								<!--{else}-->
								<!--{if $one['express_id']&&$one['express_no']}-->
								<a class="order_btn_receive " href="javascript:;" id="get_exp{$one['id']}" onclick="can_get_express({$one['id']})"  >确认收货</a>
								<!--{/if}-->
								<span class="order_status" style="margin-left:5px;display:none;" id="get_exp_s{$one['id']}" >已收货</span>
								<!--{/if}-->
							</div>
						</div>
						<!--{elseif $teams[$one['team_id']]['close_time']>0 }-->
						<div class="order_opt">
							<span class="order_status">已过期</span>
							<div class="order_btn">
								<a onclick="orderdel({$one['id']})" href="javascript:;">删除</a>
							</div>
						</div>
						<!--{/if}-->
						<!--
						<div class="order_opt">
							<span class="order_status">已取消</span>
						</div>
						-->
					</div>
				</div>
			</div>
        </div>
		<!--{/loop}-->
		</div>
		<div style="display:none;"><div>{$pagestring}</div></div>
		
         <div>
		 <div class="center" id="center_pullup" style="display:none;">
		 <span><img class="img_rotate" src="/images/pull_loading_8eba142.png"/>
		 </span><span class="orders_text"></span>
		 </div>
		<script>
		var offset = 0;
		var _pa = 2;
		var is_can_next = 1;
		var cur_url = "{$cur_url}";
		function loaddata()
		{ 
			totalheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop());     //浏览器的高度加上滚动条的高度 

			if ($(document).height() <= totalheight+200)     //当文档的高度小于或者等于总的高度的时候，开始动态加载数据
			{ 
				if(is_can_next == 1)//加载数据
				{
					is_can_next = 0;
					nextpage();
				}
			} 
		} 
		function orderdel(id)
		{
			<!--{if !empty($INI['system']['secsite']) }-->
			var del_url = '{$INI[system][wwwprefix]}{$INI[system][secsite]}ajax/order.php?action=orderdel&id='+id;
			<!--{else}-->
			
			var del_url = '{$INI[system][wwwprefix]}ajax/order.php?action=orderdel&id='+id;
			<!--{/if}-->
			
			
			
			$.ajax(
				{ 
					url: del_url, 
					dataType: 'json', 
					success: function(result){
						if(result.ret>0){
							//get_exp
							$('#orderdel_'+id).fadeOut();
							//$('.nextpage').hide();	
							return false;
						}
						
					}
				})
		}
		function can_get_express(id)
		{
			
			<!--{if !empty($INI['system']['secsite']) }-->
			var gt_url = '{$INI[system][wwwprefix]}{$INI[system][secsite]}ajax/order.php?action=orderget&id='+id;
			<!--{else}-->
			var gt_url = '{$INI[system][wwwprefix]}ajax/order.php?action=orderget&id='+id;
			<!--{/if}-->
			$.ajax(
				{ 
					url: gt_url, 
					dataType: 'json', 
					success: function(result){
						if(result.ret>0){
							//get_exp
							if(result.card_id != '')
							{
								
								<!--{if !empty($INI['system']['secsite']) }-->
								location.href = '{$INI[system][wwwprefix]}{$INI[system][secsite]}sharebonus.php?id='+result.card_id;
								<!--{else}-->
								location.href = '{$INI[system][wwwprefix]}sharebonus.php?id='+result.card_id;
								<!--{/if}-->
								return false;
							}
							$('#get_exp'+id).hide();
							$('#get_exp_s'+id).show();
							//$('.nextpage').hide();	
							return false;
						}
						
					}
				})
		}
		//rel="&id={$one['id']}"
		
		function nextpage()
		{	
			var best_url = cur_url+'&page='+_pa;
			$('#center_pullup').show();
			$.ajax(
				{ 
					url: best_url, 
					dataType: 'json', 
					success: function(result){
						if(result.ret>0){
							if(_pa != 1)
							{
								$('#center_pullup').hide();
							}
							//$('.nextpage').hide();	
							return false;
						}
						if(result.offset == offset)
						{
							$('#center_pullup').hide();
							return false;
						} else {
							offset = result.offset;
						}
						$('#order_list').append(result.html);
						$('#center_pullup').hide();
						_pa++;
						is_can_next = 1;
					}
				}
			);
		}

		$(function(){
			
			$(window).scroll( function() { 
				loaddata();
			}); 
			
		})
		</script>
	
  </div>
    <div style="height:58px;visibility:hidden "></div>
    <!--{include footer}-->




